You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
461 B
15 lines
461 B
import { getProject } from "../../service/projects";
|
|
|
|
export default defineWrappedResponseHandler(async (event) => {
|
|
const id = parseInt(getRouterParam(event, "id") || "");
|
|
if (!id || isNaN(id)) {
|
|
throw createError({ statusCode: 400, statusMessage: "无效的项目 ID" });
|
|
}
|
|
|
|
const project = await getProject(id);
|
|
if (!project) {
|
|
throw createError({ statusCode: 404, statusMessage: "项目不存在" });
|
|
}
|
|
|
|
return R.success(project);
|
|
});
|
|
|